package com.woniuxy.carlife.carlifeuserweb.service;

import com.woniuxy.carlife.carlifecommonsweb.exception.CarlifeGlobalException;
import com.woniuxy.carlife.carlifeusermodel.dto.ShippingaddressDto;
import com.woniuxy.carlife.carlifeuserweb.entity.Shippingaddress;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
 * @author zjq
 * @ClassName:ShippingaddressService
 * @Description:收货地址
 * @date 2021/4/6 20:02
 **/

public interface ShippingaddressService extends IService<Shippingaddress> {

    /*
     * 功能描述〈根据用户id查询所有的收货地址〉
     * @author:zjq
     * @param:
     * @return:
     * @Date 2021/4/12 16:00
     * @throws
     */

    public List<Shippingaddress> findShippingaddressByUserId(Integer userId);

    /*
     * 功能描述〈根据用户id查询默认收货地址〉
     * @author:zjq
     * @param:
     * @return:
     * @Date 2021/4/12 16:01
     * @throws
     */

    public Shippingaddress findShippingaddressDefaultByUserId(Integer userId);


    /*
     * 功能描述〈修改地址〉
     * @author:zjq
     * @param:
     * @return:
     * @Date 2021/4/13 5:35
     * @throws
     */

    public boolean modifyShippingaddressByshippingaddressId(ShippingaddressDto shippingaddressDto);

    /*
     * 功能描述〈删除地址〉
     * @author:zjq
     * @param:
     * @return:
     * @Date 2021/4/13 8:53
     * @throws
     */

    public boolean deleteShippingaddressByshippingaddressId(Integer shippingaddressId);

    /*
     * 功能描述〈新增地址〉
     * @author:zjq
     * @param:
     * @return:
     * @Date 2021/4/14 20:54
     * @throws
     */
    public Boolean addShippingaddress(Shippingaddress shippingaddress);



    /*
     * 功能描述〈修改掉其他地址默认地址只能有一个〉
     * @author:zjq
     * @param:
     * @return:
     * @Date 2021/4/14 23:00
     * @throws
     */
    public Boolean modifyShippingaddressDefaultByUserId(Integer userId,Integer shippingaddressDefault);

}
